home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2008 June / Macworld June 2008 CD.bin / LogMeIn / LogMeInMac.dmg / LogMeIn Installer.pkg / Contents / Resources / postflight < prev    next >
Encoding:
Text File  |  2008-01-29  |  2.3 KB  |  54 lines

  1. #!/bin/sh
  2. echo "=== Postflight started ===" >> /tmp/lmiinstalllog.txt
  3. date >> /tmp/lmiinstalllog.txt
  4.  
  5. echo "current uid=${UID}, euid=${EUID}, user=${USER}" >> /tmp/lmiinstalllog.txt
  6.  
  7. # try to remove already existing LogMeInRemoteUser (and fail silently)
  8. sudo dscl . -delete /users/LogMeInRemoteUser >/dev/null 2>&1
  9. echo "dropped LogMeInRemoteUser" >> /tmp/lmiinstalllog.txt
  10.  
  11. if [ -f /tmp/com.logmein.remoteuserpwd.txt ] ; then
  12.   echo "creating remote computer password" >> /tmp/lmiinstalllog.txt
  13.   sudo "${PACKAGE_PATH}/Contents/Resources/CreateComputerPassword" /tmp/com.logmein.remoteuserpwd.txt
  14.   SUCCESS=$?
  15.   sudo rm -f /tmp/com.logmein.remoteuserpwd.txt
  16.   if [ $SUCCESS != 0 ] ; then
  17.     echo "CreateComputerPassword failed!" >> /tmp/lmiinstalllog.txt
  18.     echo "ERROR CODE=$SUCCESS" >> /tmp/lmiinstalllog.txt
  19.     exit $SUCCESS 
  20.   fi
  21. else
  22.   echo "remote user creation is not needed" >> /tmp/lmiinstalllog.txt
  23. fi
  24.  
  25. if [ -f /tmp/com.logmein.newconfig.xml ] ; then
  26.   echo "replacing config.xml" >> /tmp/lmiinstalllog.txt  
  27.   sudo cp -f "/Library/Application Support/LogMeIn/config.xml" "/Library/Application Support/LogMeIn/config.xml.bak"
  28.   sudo cp -f /tmp/com.logmein.newconfig.xml "/Library/Application Support/LogMeIn/config.xml" >> /tmp/lmiinstalllog.txt  2>&1
  29.   sudo rm -f /tmp/com.logmein.newconfig.xml
  30. else
  31.   echo "replacing config.xml was not needed" >> /tmp/lmiinstalllog.txt
  32. fi
  33.  
  34. # make sure LMILaunchAgentFixer is running
  35. echo "open /Library/Application Support/LogMeIn/LMILaunchAgentFixer.app/" >> /tmp/lmiinstalllog.txt
  36. sudo -u "${USER}" open "/Library/Application Support/LogMeIn/LMILaunchAgentFixer.app/" 
  37. sleep 3
  38.  
  39. # remove update folder
  40. sudo rm -rf "/Library/Application Support/LogMeIn/update"
  41.  
  42. # add suid to logmeinserverctl
  43. sudo chown root "/Library/Application Support/LogMeIn/bin/LogMeIn.app/Contents/Resources/logmeinserverctl"
  44. sudo chmod u+s "/Library/Application Support/LogMeIn/bin/LogMeIn.app/Contents/Resources/logmeinserverctl"
  45.  
  46. sleep 2 # wait a bit for the old server to die
  47.  
  48. sudo -u "${USER}" "/Library/Application Support/LogMeIn/bin/LogMeIn.app/Contents/Resources/logmeinserverctl" start 2>&1 | tee -a /tmp/lmiinstalllog.txt
  49.  
  50. sleep 2 # wait for server to start
  51. #sudo -u "${USER}" open "file:///Library/Application%20Support/LogMeIn/SetupLicense.html?username=${USER}"
  52. ### sudo -u "${USER}" open "http://localhost:2002?username=${USER}"
  53.  
  54.